﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace AppDesigner.iUIRender
{
    public class UILabelRender : BaseUIRender
    {
        public override FrameworkElement GenerateElement()
        {
            TextBlock label = new TextBlock();
            label.Text = "TextBlock";
            label.Foreground = new SolidColorBrush(Colors.White);
            return label;
        }

        public override void RenderToCanvas()
        {
            Canvas.SetLeft(_currentElement, Position.X);
            Canvas.SetTop(_currentElement, Position.Y);
            Parent.Children.Add(_currentElement);
        }

        public override void RenderToStackPanel()
        {
            throw new NotImplementedException();
        }

        public override void RenderToGrid()
        {
            throw new NotImplementedException();
        }

        public override void RenderToCustom()
        {
            throw new NotImplementedException();
        }

        public override void RenderSelf()
        {
            _currentElement.Width = Size.Width;
            _currentElement.Height = Size.Height;
            _currentElement.Name = Name;
        }
    }
}
